<!DOCTYPE html>
<html lang="en" >
<head>
    <title>Atomsk - Option fix - Pierre Hirel</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" media="screen" type="text/css" title="Default" href="./default.css" />
    <link rel="icon" href="../img/atomsk_logo.png" type="image/png" />
</head>
   
<body>

<p><a href="./index.html">Back to main menu</a></p>

<h2>Option: fix</h2>

<h4>Syntax</h4>

<p><code>-fix &#60;axis&#62;</code></p>

<p><code>-fix &#60;axis&#62; &#60;above|below&#62; &#60;d&#62; &#60;normal&#62;</code></p>


<h4>Description</h4>

<p>This option allows to fix or "freeze" the X, Y and/or Z coordinates of some atoms.</p>

<p>The parameters for this option are the following:</p>
<ul>
  <li><strong>axis</strong>: coordinate to be frozen, can be 'x', 'y', 'z' (referring to cartesian directions), or 'all' (the latter indicates that atoms will be frozen in the three directions of space).</li>
  <li><strong>above|below</strong>: this keyword decides if it is the atoms above or below the plane that are fixed.</li>
  <li><strong>d</strong>: distance from the origin of the axis where the plane is placed, in angstr&ouml;ms (&Aring;).</li>
  <li><strong>normal</strong>: direction perpendicular to the plane of fix; can be x, y, z, or a crystallographic direction (see below).</li>
</ul>

<p>The distance &#60;d&#62; is usually given in &Aring;. It is also possible to give it with respect to the box dimension along &#60;axis&#62; with the keyword BOX and an operation (see <a href="./box.html">this page</a>).</p>

<p>The &#60;normal&#62; can be one of 'x', 'y', 'z' (referring to cartesian axes), or a crystallographic direction defined by its Miller indices (see <a href="./options.html">how to specify Miller indices</a>). If the crystallographic orientation of the system is defined (e.g. through the <a href="./option_properties.html">option <code>-properties</code></a>) then the Miller indices are considered with respect to that orientation. Otherwise the orientation assumed is X=[100], Y=[010], Z=[001].</p>

<p>Note that this option does not actually make atoms inert for Atomsk, it just "marks" them as fixed (by adding three auxiliary properties to each atom: fixx, fixy, fixz). As far as Atomsk is concerned, fixed atoms are not different from other atoms. Only when writing the output files will the fixed atoms be marked differently in formats that support it (see the <a href="./formats.html">list of formats</a>). In order to restrict the options of Atomsk to only some atoms one may use the <a href="./option_select.html">option <code>-select</code></a>.</p>

<p>This option can be used several times to fix atoms in several directions, or to fix different atoms (see example 2 below).</p>

<p>If some atoms have shells (in the sense of an ionic core-shell model), then only the core is fixed (and not the shell).</p>

<p>If a selection was defined (with the <a href="./option_select.html">option <code>-select</code></a>) then only selected atoms are fixed.</p>


<h4>Default</h4>

<p>By default no atom is fixed.</p>


<h4>Examples</h4>

<ul>
<li><code class="command">atomsk initial.xsf -fix Y final.gin</code>
<p>This will read the file <code>initial.xsf</code>, and fix the Y coordinate of all atoms. The result will be output to the file <code>final.gin</code>.</p></li>

<li><code class="command">atomsk system.xsf -select out box 10 BOX-10 10 BOX-10 10 BOX-10 -fix all lammps</code>
<p>This will read the file <code>system.xsf</code>, <a href="./option_select.html">select atoms</a> that are within 10 &Aring; of each boundary, and fix these atoms (in all three coordinates X, Y and Z). The result will be output to the file <code>system.lmp</code>.</p></li>

<li><code class="command">atomsk system.xsf -fix x above 5 z gin</code>
<p>This will read the file <code>system.xsf</code>, and fix the X coordinate of all atoms that are above 5 &Aring; along Z. The result will be output to the file <code>system.gin</code>.</p></li>

<li><code class="command">atomsk initial.xsf -fix x below 2.4 z -fix y below 2.4 z final.gin</code>
<p>This will fix the X and Y coordinates of all atoms that are below 2.4 &Aring; along Z.</p></li>

<li><code class="command">atomsk initial.xsf -fix all below 0.2*BOX z -fix all above 0.8*BOX z final.gin</code>
<p>This will fix all atoms that are below 0.2 times the box height along Z, or above 0.8 times that height.</p></li>
</ul>

<p><a href="./index.html">Back to main menu</a></p>

</body>

</html>
